unit da_triangle;

{$mode Delphi}

interface

uses
    Classes, SysUtils, Math, da_point;

type

    TDATriangle = class
    private
    	head_f: TDAPoint;
    	head_s: TDAPoint;
    	head_t: TDAPoint;
    	function get_slen(head_f, head_s: TDAPoint) :Real;
    public
    	function get_head_f() :TDAPoint;
    	function get_head_s() :TDAPoint;
    	function get_head_t() :TDAPoint;
    	function get_slen_f() :Real;
    	function get_slen_s() :Real;
    	function get_slen_t() :Real;
    end;

implementation

function TDATriangle.get_head_f() :TDAPoint;
begin
	get_head_f := head_f;
end;

function TDATriangle.get_head_s() :TDAPoint;
begin
	get_head_s := head_s;
end;

function TDATriangle.get_head_t() :TDAPoint;
begin
	get_head_t := head_t;
end;

function TDATriangle.get_slen(head_f, head_s: TDAPoint) :Real;
const
	PREC_V = -4;
begin
	get_slen := RoundTo(SQRT(SQR(head_s.get_rcoord.X - head_f.get_rcoord.X) + 
					 		 SQR(head_s.get_rcoord.Y - head_f.get_rcoord.Y)), PREC_V);
end;

function TDATriangle.get_slen_f() :Real;
begin
	get_slen_f := get_slen(head_f, head_s);
end;

function TDATriangle.get_slen_s() :Real;
begin
	get_slen_s := get_slen(head_f, head_t);
end;

function TDATriangle.get_slen_t() :Real;
begin
	get_slen_t := get_slen(head_t, head_s);
end;

end.

